
* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
* Graphs of Earnings in the LFS 
* 10/23/23
* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
use "LFSCollapsedIncome.dta", clear

* %%%%%%% Decade Average %%%%%%%
* %%%%%%% Figure A7 %%%%%%%

ren askermale male 
sort year province male edlvl agegr 
tw (line dinc year if male==1 & agegr==1 & edlvl==1 & province==2,lp(dash) lcolor(black) ylabel(-1(0.2)1)) ///
(scatter dinc year if male==1 & agegr==1 & edlvl==1 & province==2, mcolor(black) ylabel(-1(0.2)1)) ///
(line dinc year if male==1 & agegr==2 & edlvl==1 & province==2, lp(dash_dot) lcolor(black*0.5) ylabel(0(0.2)1)) ///
(scatter dinc year if male==1 & agegr==2 & edlvl==1 & province==2, mcolor(black*0.5) ylabel(-1(0.2)1)) ///
(line dinc year if male==1 & agegr==3 & edlvl==1 & province==2, lcolor(black*0.8) ylabel(-1(0.2)1))  ///
(scatter dinc year if male==1 & agegr==3 & edlvl==1 & province==2, mcolor(black*0.8) ylabel(-1(0.2)1) ///
 xtitle("Year", size(medsmall))   ///
 legend(order(1 "20-30" 3 "30-40" 5 "40-50")) ///
ytitle("Earnings Deviations, Male") graphregion(color(white)))

graph export 

sort year province male edlvl agegr 
tw (line dinc year if male==1 & agegr==1 & edlvl==2 & province==2,lp(dash) lcolor(black) ylabel(-1(0.2)1)) ///
(scatter dinc year if male==1 & agegr==1 & edlvl==2 & province==2, mcolor(black) ylabel(-1(0.2)1)) ///
(line dinc year if male==1 & agegr==2 & edlvl==2 & province==2, lp(dash_dot) lcolor(black*0.5) ylabel(0(0.2)1)) ///
(scatter dinc year if male==1 & agegr==2 & edlvl==2 & province==2, mcolor(black*0.5) ylabel(-1(0.2)1)) ///
(line dinc year if male==1 & agegr==3 & edlvl==2 & province==2, lcolor(black*0.8) ylabel(-1(0.2)1))  ///
(scatter dinc year if male==1 & agegr==3 & edlvl==2 & province==2, mcolor(black*0.8) ylabel(-1(0.2)1) ///
 xtitle("Year", size(medsmall))   ///
 legend(order(1 "20-30" 3 "30-40" 5 "40-50")) ///
ytitle("Earnings Deviations, Male") graphregion(color(white)))

graph export

sort year province male edlvl agegr 
tw (line dinc year if male==1 & agegr==1 & edlvl==3 & province==2,lp(dash) lcolor(black) ylabel(-1(0.2)1)) ///
(scatter dinc year if male==1 & agegr==1 & edlvl==3 & province==2, mcolor(black) ylabel(-1(0.2)1)) ///
(line dinc year if male==1 & agegr==2 & edlvl==3 & province==2, lp(dash_dot) lcolor(black*0.5) ylabel(0(0.2)1)) ///
(scatter dinc year if male==1 & agegr==2 & edlvl==3 & province==2, mcolor(black*0.5) ylabel(-1(0.2)1)) ///
(line dinc year if male==1 & agegr==3 & edlvl==3 & province==2, lcolor(black*0.8) ylabel(-1(0.2)1))  ///
(scatter dinc year if male==1 & agegr==3 & edlvl==3 & province==2, mcolor(black*0.8) ylabel(-1(0.2)1) ///
 xtitle("Year", size(medsmall))   ///
 legend(order(1 "20-30" 3 "30-40" 5 "40-50")) ///
ytitle("Earnings Deviations, Male") graphregion(color(white)))

graph export 


* %%% With separate means for <1996 and post 1996 (half-decade average) %%%
* %%%%%%% Figure A7 %%%%%%%

sort year province male edlvl agegr 
tw (line dinc2 year if male==1 & agegr==1 & edlvl==1 & province==2,lp(dash) lcolor(black) ylabel(-1(0.2)1)) ///
(scatter dinc2 year if male==1 & agegr==1 & edlvl==1 & province==2, mcolor(black) ylabel(-1(0.2)1)) ///
(line dinc2 year if male==1 & agegr==2 & edlvl==1 & province==2, lp(dash_dot) lcolor(black*0.5) ylabel(0(0.2)1)) ///
(scatter dinc2 year if male==1 & agegr==2 & edlvl==1 & province==2, mcolor(black*0.5) ylabel(-1(0.2)1)) ///
(line dinc2 year if male==1 & agegr==3 & edlvl==1 & province==2, lcolor(black*0.8) ylabel(-1(0.2)1))  ///
(scatter dinc2 year if male==1 & agegr==3 & edlvl==1 & province==2, mcolor(black*0.8) ylabel(-1(0.2)1) ///
 xtitle("Year", size(medsmall))   ///
 legend(order(1 "20-30" 3 "30-40" 5 "40-50")) ///
ytitle("Earnings Deviations, Male") graphregion(color(white)))

graph export 

sort year province male edlvl agegr 
tw (line dinc2 year if male==1 & agegr==1 & edlvl==2 & province==2,lp(dash) lcolor(black) ylabel(-1(0.2)1)) ///
(scatter dinc2 year if male==1 & agegr==1 & edlvl==2 & province==2, mcolor(black) ylabel(-1(0.2)1)) ///
(line dinc2 year if male==1 & agegr==2 & edlvl==2 & province==2, lp(dash_dot) lcolor(black*0.5) ylabel(0(0.2)1)) ///
(scatter dinc2 year if male==1 & agegr==2 & edlvl==2 & province==2, mcolor(black*0.5) ylabel(-1(0.2)1)) ///
(line dinc2 year if male==1 & agegr==3 & edlvl==2 & province==2, lcolor(black*0.8) ylabel(-1(0.2)1))  ///
(scatter dinc2 year if male==1 & agegr==3 & edlvl==2 & province==2, mcolor(black*0.8) ylabel(-1(0.2)1) ///
 xtitle("Year", size(medsmall))   ///
 legend(order(1 "20-30" 3 "30-40" 5 "40-50")) ///
ytitle("Earnings Deviations, Male") graphregion(color(white)))

graph export 

sort year province male edlvl agegr 
tw (line dinc2 year if male==1 & agegr==1 & edlvl==3 & province==2,lp(dash) lcolor(black) ylabel(-1(0.2)1)) ///
(scatter dinc2 year if male==1 & agegr==1 & edlvl==3 & province==2, mcolor(black) ylabel(-1(0.2)1)) ///
(line dinc2 year if male==1 & agegr==2 & edlvl==3 & province==2, lp(dash_dot) lcolor(black*0.5) ylabel(0(0.2)1)) ///
(scatter dinc2 year if male==1 & agegr==2 & edlvl==3 & province==2, mcolor(black*0.5) ylabel(-1(0.2)1)) ///
(line dinc2 year if male==1 & agegr==3 & edlvl==3 & province==2, lcolor(black*0.8) ylabel(-1(0.2)1))  ///
(scatter dinc2 year if male==1 & agegr==3 & edlvl==3 & province==2, mcolor(black*0.8) ylabel(-1(0.2)1) ///
 xtitle("Year", size(medsmall))   ///
 legend(order(1 "20-30" 3 "30-40" 5 "40-50")) ///
ytitle("Earnings Deviations, Male") graphregion(color(white)))

graph export 
